<%@ page pageEncoding="UTF-8"%>
<%@ include file="../common/head.jsp"%>
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<%@ include file="./msg/meta.jsp"%>
</head>
<body>
	<div class="x-nav">
		<span class="layui-breadcrumb">
			<a>
				<cite>${actionname }</cite>
			</a>
		</span>
		<a class="layui-btn layui-btn-small" style="line-height: 1.6em; margin-top: 3px; float: right"
			onclick="location.reload()" title="刷新">
			<i class="layui-icon layui-icon-refresh" style="line-height: 30px"></i>
		</a>
	</div>
	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
				<div class="layui-card">
					<div class="layui-card-body">
						<form class="layui-form layui-col-space5" action="${ctx}/sys/query${actionclass}.do" method="post">
							<div class="layui-inline layui-show-xs-block">
								<input type="text" name="s_title" placeholder="题目" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<select name="s_coursesel">
									<option value="">科目</option>
									<option value="科目一">科目一</option>
									<option value="科目四">科目四</option>
								</select>
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<select name="s_quesType">
									<option value="">题型</option>
									<option value="单选题">单选题</option>
									<option value="判断题">判断题</option>
									<option value="多选题">多选题</option>
								</select>
							</div>
<!-- 							<div class="layui-input-inline layui-show-xs-block"> -->
<!-- 								<select name="s_"> -->
<!-- 									<option value="">全部</option> -->
<!-- 								</select> -->
<!-- 							</div> -->
							<div class="layui-inline layui-show-xs-block">
								<button class="layui-btn" lay-submit="" lay-filter="sreach">
									<i class="layui-icon">&#xe615;</i>
								</button>
							</div>
						</form>
					</div>
					<div class="layui-card-header">
						<button class="layui-btn layui-btn-danger" onclick="doajaxselect('${ctx}/sys/delete${actionclass}.do','确认要删除信息吗')">
							<i class="layui-icon"></i>批量删除
						</button>
						<button class="layui-btn" onclick="xadmin.open('添加${actionname}','${ctx}/sys/add2${actionclass}.do',1024,800)">
							<i class="layui-icon"></i>添加${actionname}
						</button>
					</div>
					<div class="layui-card-body layui-table-body layui-table-main">
						<table class="layui-table layui-form">
							<thead>
								<tr>
									<th style="min-width: 1px; width: 10px">
										<input type="checkbox" lay-filter="checkall" name="" lay-skin="primary">
									</th>
									<th width="100">科目</th>
									<th width="100">车型</th>
									<th width="100">专项</th>
									<th width="100">题型</th>
									<th width="100">分值</th>
									<th width="500">题目</th>
									<th width="100">答案</th>

									<th width="100">操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${SESSION_PAGE.list}" var="item">
									<tr>
										<td style="min-width: 1px; width: 10px">
											<input type="checkbox" name="delid" value="${item.id }" lay-skin="primary">
										</td>
										<td>${item.coursesel}</td>
										<td>${item.cxsel}</td>
										<td>${item.questionItem.qitem}</td>
										<td>${item.quesType}</td>
										<td>${item.score}</td>
										<td>${item.title}</td>
										<td>${item.answer}</td>

										<td class="td-manage">
											<a title="编辑"
												onclick="xadmin.open('${actionname}信息','${ctx}/sys/get${actionclass}.do?uid=${item.id}',1024,800)"
												href="javascript:;">
												<i class="layui-icon">&#xe642;</i>
											</a>
											<a title="删除" onclick="doajax('${ctx}/sys/delete${actionclass}.do?ids=${item.id}','确认要删除信息吗')"
												href="javascript:;">
												<i class="layui-icon">&#xe640;</i>
											</a>
										</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div class="layui-card-body ">
						<div id="mypageinfo" style="text-align: center;"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script>
	layui.use([ 'laydate', 'form' ], function() {
		var laydate = layui.laydate;
		var form = layui.form;
		// 监听全选
		form.on('checkbox(checkall)', function(data) {
			if (data.elem.checked) {
				$('tbody input').prop('checked', true);
			} else {
				$('tbody input').prop('checked', false);
			}
			form.render('checkbox');
		});
		//执行一个laydate实例
		laydate.render({
			elem : '#start' //指定元素
		});
	});
 	$(function(){
 		layui.use('laypage', function(){
			var laypage = layui.laypage;
			 //执行一个laypage实例
			laypage.render({
			elem : 'mypageinfo',
			count : ${SESSION_PAGE.totalNumber}, //数据总数
			limit : ${SESSION_PAGE.itemsPerPage},
			curr : ${SESSION_PAGE.currentPageNumber},
			layout : ["prev","page","next","count"],
			 	jump: function(obj, first){
			    //obj包含了当前分页的所有参数，比如：
			    //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
			    //console.log(obj.limit); //得到每页显示的条数
			    //首次不执行
			    if(!first){
			    	location.href = '?pageCurrent='+obj.curr+"&newpage=newpage";
			    }
			  }
			 });
		});
 	});
</script>
</html>
<%@ include file="../common/clear.jsp"%>
